package com.seetaface.common.exception;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @Author LS
 * @Description
 * @Data 2022/8/23 16:20
 */
public class MessageException {

    public static String getStackTrace(Throwable throwable) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw, true);
        try {
            throwable.printStackTrace(pw);
            return sw.getBuffer().toString();
        } finally {
            pw.close();
        }
    }
}
